import request from '@/utils/request'

// 区域列表
export const getRegionSearchList = params => request.get('/vm-service/region/search', { params })

// 区域管理
// 新增区域
export const postRegion = (data) => request.post('/vm-service/region', data)
// 修改区域
export const changeRegion = id => request.put(`/vm-service/region/${id}`)

// 删除区域
export const delRegion = id => request.delete(`/vm-service/region/${id}`)
// 获取区域详情
export const getRegionFn = id => request.get(`/vm-service/region/${id}`)
// 区域管理

// 点位
export const getNode = (data) => request.get('/vm-service/node/search', {
  params: {
    ...data
  }
})
// 点位详情
export const getDetail = id => request.get(`/vm-service/node/vmList/${id}`)
// 删除点位
export const delNode = id => request.delete(`/vm-service/node/${id}`)
// 新建点位
export const addNode = data => request.post('/vm-service/node', data)
// 所属商圈
export const getPartner = () => request.get('/vm-service/businessType')
// 归属合作商
export const getNodeCollect = () => request.get('/vm-service/node/nodeCollect')
// 修改点位
export const changeNode = id => request.put(`/vm-service/node/${id.id}`, {
  ...id
})
// 搜索
export const searchNode = data => request.get('/vm-service/node/search', {
  params: {
    ...data
  }
})
// 合作商列表
export const getServer = params => request.get('/user-service/partner/search', {
  params
})
// 新增合作商
export const postServe = data => request.post('/user-service/partner', {
  ...data
})
// 删除合作商
export const delServe = id => request.delete(`/user-service/partner/${id}`)
// 修改合作商
export const changeServe = id => request.put(`/user-service/partner/${id.id}`, {
  ...id
})
// 重置密码
export const resetServe = id => request.put(`/user-service/partner/resetPwd/${id}`)
// 合作商搜索
export const searchServe = data => request.get('/user-service/partner/search', data.id)
